package com.LostAndFound.dao;

import java.sql.SQLException;

import org.apache.commons.dbutils.QueryRunner;

import com.LostAndFound.domain.Article;
import com.LostAndFound.utils.DataSourceUtils;

public class IssueDao {

	public void addNewIssue(Article article) throws SQLException {
		QueryRunner runner = new QueryRunner(DataSourceUtils.getDataSource());
		String sql = "insert into article values(?,?,?,?,?,?,?,?,?,?,?)";
		Object[] params = {article.getAid(),article.getTitle(),article.getDetailInfo(),
				article.getIssueTime(),article.getImage(),article.getPhone(),
				article.getWhatFlag(),article.getFoundFlag(),article.getInvalidFlag(),
				article.getCategory().getCid(),article.getUser().getUid()};
		runner.update(sql, params);
	}

}
